import { BasicColumn } from '/@/components/Table';
import { assign } from 'lodash-es';
import { render } from '/@/utils/common/renderUtils';
// import { YesOrNoEnum } from '/@/enums/borgriseEnum';

export const userStatusColumn = (options?: BasicColumn): BasicColumn => {
  const _default: BasicColumn = {
    title: '状态',
    dataIndex: 'status',
    width: 80,
    customRender: ({ value }) => render.renderUserStatus(value),
  };
  return assign(_default, options);
};

export const userIDColumn = (options?: BasicColumn): BasicColumn => {
  const _default: BasicColumn = {
    title: 'ID',
    dataIndex: 'id',
    width: 80,
  };
  return assign(_default, options);
};

// export const useYesOrNoColumn = (options?: BasicColumn): BasicColumn => {
//   const _default: BasicColumn = {
//     width: 80,
//     customRender: ({ value }) => {
//       let color = 'success';
//       let text = '是';
//
//       if (value == YesOrNoEnum.NO || isNull(value)) {
//         text = '否';
//         color = 'error';
//       }
//
//       return render.renderTag(text, color);
//     },
//   };
//   return assign(_default, options);
// };

export const userRemarksColumn = (options?: BasicColumn): BasicColumn => {
  const _default: BasicColumn = {
    title: '备注',
    dataIndex: 'remark',
    align: 'left',
  };
  return assign(_default, options);
};
